<html>
<head><meta charset="utf-8"><title>How to document the types created by async blocks? · t-lang/doc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/index.html">t-lang/doc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html">How to document the types created by async blocks?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227071607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227071607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227071607">(Feb 20 2021 at 06:38)</a>:</h4>
<p>Just as a closure expression makes an anonymous type that implements various traits, an async block makes an anonymous type that implements the Future trait (and maybe others?). So does that mean we need a page for them?</p>



<a name="227072264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227072264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227072264">(Feb 20 2021 at 06:55)</a>:</h4>
<p>Alternatively, we could rename the <code>Closure types</code> chapter to something that encompasses both closures and futures, although I cannot think of a good name. This is not without merit, since both of them share a lot of details.</p>



<a name="227072321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227072321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227072321">(Feb 20 2021 at 06:56)</a>:</h4>
<p>Or we could just say that async blocks create closures. Although I'd want confirmation from the lang team before doing that.</p>



<a name="227073995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227073995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227073995">(Feb 20 2021 at 07:32)</a>:</h4>
<p>"Voldemort types"? :)</p>



<a name="227074417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227074417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227074417">(Feb 20 2021 at 07:41)</a>:</h4>
<p>Is that term actually used academically, or is it just colloquial usage</p>



<a name="227074664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227074664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227074664">(Feb 20 2021 at 07:46)</a>:</h4>
<p>I found a few hits for voldemort types in D, unnameable types and closure types in Rust, and anonymous types in C#, Java, and Go</p>



<a name="227074688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227074688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227074688">(Feb 20 2021 at 07:47)</a>:</h4>
<p>It's not clear to me whether the use of anonymous types is specific to the OO use of this construct, because it's a pretty good choice otherwise</p>



<a name="227074778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227074778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227074778">(Feb 20 2021 at 07:49)</a>:</h4>
<p>The main danger I think is confusing it with structural types (as opposed to nominal types) like the tuple type, or typedefs over a tuple type</p>



<a name="227074783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227074783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227074783">(Feb 20 2021 at 07:49)</a>:</h4>
<p>but at least in C# / Java / Go anonymous types are nominal</p>



<a name="227075812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/How%20to%20document%20the%20types%20created%20by%20async%20blocks%3F/near/227075812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/How.20to.20document.20the.20types.20created.20by.20async.20blocks.3F.html#227075812">(Feb 20 2021 at 08:07)</a>:</h4>
<p>&lt;deleted; offtopic&gt;</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>